﻿using System;
using System.Collections.Generic;
using PMP.Core.Enums;
using SqlSugar;

namespace PMP.Core.Entities;

/// <summary>
/// 项目表
/// </summary>
public class TbProject : BaseEntity
{
    /// <summary>
    /// 项目编号
    /// </summary>
    public string ProjectCode { get; set; }
    /// <summary>
    /// 项目序号（同一天第x个项目）
    /// </summary>
    public int ProjectNum { get; set; }
    /// <summary>
    /// 项目等级
    /// </summary>
    public EnumProjectLevel ProjectLevel { get; set; }
    /// <summary>
    /// 项目名称
    /// </summary>
    public string ProjectName { get; set; } = string.Empty;
    /// <summary>
    /// 公司名称
    /// </summary>
    public string CompanyName { get; set; } = string.Empty;
    /// <summary>
    /// 项目来源
    /// </summary>
    public string ProjectSource { get; set; } = string.Empty;
    /// <summary>
    /// 项目标签
    /// </summary>
    [SugarColumn(IsJson = true)]
    public List<string> ProjectTags { get; set; } = new();
    /// <summary>
    /// 项目描述
    /// </summary>
    [SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string ProjectDescription { get; set; } = string.Empty;
    /// <summary>
    /// 项目需求
    /// </summary>
    [SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string ProjectDemand { get; set; } = string.Empty;
    /// <summary>
    /// 是否完结
    /// </summary>
    public bool IsFinished { get; set; } = false;
    /// <summary>
    /// 项目附件
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(TbProjectAttachment.ProjectId))]
    public List<TbProjectAttachment> Attachments { get; set; } = new();
    
    /// <summary>
    /// 项目负责人
    /// </summary>
    public int ResponsibleUserId { get; set; }

    /// <summary>
    /// 项目负责人名称
    /// </summary>
    public string ResponsibleUserName { get; set; } = "";
    /// <summary>
    /// 收益（万元）
    /// </summary>
    public decimal Income { get; set; }
    /// <summary>
    /// 项目属地
    /// </summary>
    public string Location { get; set; }
}